const app = getApp()
Page({
  data: {
    domainName: app.domainName,
    username:''
  },
  onLoad() {
    var _this=this;
    wx.request({
      url: app.domainName + 'web/?c=getusername',
      method: 'POST',
      data: {openid:app.globalData.openid}, header: { 'content-type': 'application/x-www-form-urlencoded' },
      success: function (res) {
        _this.setData({username:res.data.u.name})
      }});
  },
  quxiao(){
    wx.request({
      url: app.domainName + 'web/?c=quxiao',
      method: 'POST',
      data: {openid:app.globalData.openid}, header: { 'content-type': 'application/x-www-form-urlencoded' },
      success: function (res) {
           wx.redirectTo({url: '/pages/welcome/index'});
           return;
      }});
  },
  tixing(){
    wx.request({
      url: app.domainName + 'web/?c=tixing',
      method: 'POST',
      data: {openid:app.globalData.openid}, header: { 'content-type': 'application/x-www-form-urlencoded' },
      success: function (res) {
          wx.showToast({
            title: "提醒成功",
            icon: 'success',
            duration: 1500
          })
      }});
  },
  gocenter(){
    wx.redirectTo({url: '/pages/zdui/index'});
  }
 
})
